control = "tmp"
measure = "tmp01"
output = "qq01_hanmir.eps"

xlab = "p(x) of media with 1 second interarrivals"
filename = "/log_media.log"

datafile_control = paste(control, filename, sep="")
datafile_measure = paste(measure, filename, sep="")

cdata <- read.table(datafile_control)
mdata <- read.table(datafile_measure)

cdata <- data.frame(mid=cdata[[1]], ratio1=cdata[[5]])
mdata <- data.frame(mid=mdata[[1]], ratio2=mdata[[5]])

cdata <- cdata[cdata$ratio1 > 0.001,]
mdata <- mdata[mdata$ratio2 > 0.001,]

mergedata = merge(cdata, mdata)

plotdata = data.frame(x=mergedata[[3]], y=mergedata[[2]])
plot(plotdata, log="xy", xlab=xlab, ylab = "p(x) of media with all arrivals")
abline(0,1)

dev.print(device=postscript, output, horizontal = T)